package com.example.demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-11-12
 * Time: 15:47
 */
public class User {
    private String name;
    private int age;
    //因为这个是User类的成员变量，有默认值，前段不穿age的值都为0，当age为普通变量的时候就不行
    private String gender;

    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }
}

